<!DOCTYPE html>
<html style="height: 100%;">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  <title>
    <%= htmlWebpackPlugin.options.title %>
  </title>
  <style>
    html,body{
      width: 100%;
      height: 100%;
    }
    
  </style>
</head>

<body style="height: 100%;">
  <noscript>
    <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
        Please enable it to continue.</strong>
  </noscript>
  <div id="app"></div>
  <!-- built files will be auto injected -->
  <script src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script>
  <script>
    if('geolocation' in navigator){
//				调用navigator.geolocation下的方法获取位置信
//				第三个参数设置的是超时提醒  如果超时10ms就会显示超时
			navigator.geolocation.getCurrentPosition(successCB,errorCB,{timeout:10})
		}else{
			alert('不支持geolocation')
		}
    //			成功
			function successCB(res){
        console.log(32);
        console.log(res.coords.latitude);
        console.log(res.coords.longitude);
				// lat.innerHTML =  '维度' + res.coords.latitude;
				// lon.innerHTML = '经度' + res.coords.longitude
			}
			function errorCB(res){
        console.log(222222);
				console.log(res);
      }
  </script>
</body>

</html>